package leetcode.lt100;

import java.util.Arrays;

class Solution_58 {
	
	
	public static void main(String[] args) {
		String s = "ss fdafdas asdfdasfads  dss    sdf";
		String[] ss = s.split(" ");
		Arrays.asList(ss).forEach(System.out::println);
	}
	public int lengthOfLastWord(String s) {
		String[] ss = s.split(" ");
		int l = ss.length;
		for(int i = l-1;i>=0;i--){
			if(!ss[i].equals("")){
				return ss[i].length();
			}
		}
		return 0;
	}
}